
$(function(){
	
	

	$(document).on('click','.actions-1', function () {
		var wujiaimage = $('.buy-wujia p').text();	
		var buxingjieimage = $('.buy-buxingjie p').text();
		var beimenimage = $('.buy-beimen p').text();
		  var buttons1 = [
			{
			  text: '请选择门店',
			  label: true
			},
			{
			  text: '船说（伍家岗店）',
			  bold: true,
			  color: 'danger',
			  onClick: function() {
				$.modal({
				  title: '长按识别二维码立即下单',
				  afterText:  '<div class="swiper-container" style="width: auto; margin:5px -15px -15px 1px">'+
								'<div class="swiper-pagination"></div>'+
								'<div class="swiper-wrapper">'+
								  '<div class="swiper-slide"><img src="'+wujiaimage+'" height="150" style="display:block"></div>' +
								'</div>'+
							  '</div>',
				  buttons: [
					{
					  text: '返回'
					},
				  ]
				});
			  }
			},
			{
			  text: '船说（步行街店）',
			  bold: true,
			  color: 'danger',
			  onClick: function() {
				$.modal({
				  title: '长按识别二维码立即下单',
				  afterText:  '<div class="swiper-container" style="width: auto; margin:5px -15px -15px 1px">'+
								'<div class="swiper-pagination"></div>'+
								'<div class="swiper-wrapper">'+
								  '<div class="swiper-slide"><img src="'+buxingjieimage+'" height="150" style="display:block"></div>' +
								'</div>'+
							  '</div>',
				  buttons: [
					{
					  text: '返回'
					},
				  ]
				});
			  }
			},
			{
			  text: '船说（北门店）',
			  bold: true,
			  color: 'danger',
			  onClick: function() {
				$.modal({
				  title: '长按识别二维码立即下单',
				  afterText:  '<div class="swiper-container" style="width: auto; margin:5px -15px -15px 1px">'+
								'<div class="swiper-pagination"></div>'+
								'<div class="swiper-wrapper">'+
								  '<div class="swiper-slide"><img src="'+beimenimage+'" height="150" style="display:block"></div>' +
								'</div>'+
							  '</div>',
				  buttons: [
					{
					  text: '返回'
					},
				  ]
				});
			  }
			},
		  ];
		  var buttons2 = [
			{
			  text: '取消',
			  bg: 'danger'
			}
		  ];
		  var groups = [buttons1, buttons2];
		  $.actions(groups);
	  });
	  
	$(document).on('click','.actions-2', function () {
		var image = $('.go-image p').text();
		var modal = $.modal({
		  title: '长按识别二维码立即下单',
		  afterText:  '<div class="swiper-container" style="width: auto; margin:5px -15px -15px 1px">'+
						'<div class="swiper-pagination"></div>'+
						'<div class="swiper-wrapper">'+
						  '<div class="swiper-slide"><img src="'+image+'" height="150" style="display:block"></div>'+
						'</div>'+
					  '</div>',
		  buttons: [
			{
			  text: '返回'
			},
			
		  ]
		})
		$.swiper($(modal).find('.swiper-container'), {pagination: '.swiper-pagination'});
	});
		
		

		$(document).on('click','.zan', function () {
			var zan = $('.zan p').text();
			$.post('php/zan.php', { zan: zan }, function(response){
			// process response
			//	alert(response);
				$('.zan p').text(response);
			})
		});
		
		
		
		
		$(document).on('click','.cai', function () {
			var cai = $('.cai p').text();
			$.post('php/cai.php', { cai: cai }, function(response){
			// process response
			//	alert(response);
				$('.cai p').text(response);
			})
		});
		
		//百度统计
		var _hmt = _hmt || [];
		(function() {
		  var hm = document.createElement("script");
		  hm.src = "https://hm.baidu.com/hm.js?ef2dd60dce09a8ef83db9fda56305429";
		  var s = document.getElementsByTagName("script")[0]; 
		  s.parentNode.insertBefore(hm, s);
		})();
		

	
	 
});	
		
	
	